package mr.zhang.controller;

import mr.zhang.dao.domain.Merchant;
import mr.zhang.service.TestMyBatisService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class SavePMerchantPropertyController extends AbstractController {

	private TestMyBatisService testMyBatisService;

	private String toview;

	public TestMyBatisService getTestMyBatisService() {
		return testMyBatisService;
	}

	public void setTestMyBatisService(TestMyBatisService testMyBatisService) {
		this.testMyBatisService = testMyBatisService;
	}

	public String getToview() {
		return toview;
	}

	public void setToview(String toview) {
		this.toview = toview;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub

		List<Merchant> list = this.testMyBatisService.queryMerchantall();

		Map<String, Object> model = new HashMap<String, Object>();

		model.put("list", list);

		return new ModelAndView(getToview(), model);

	}

}
